﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace petibandi
{
    class BankModel
    {
        int balance = 40000;
        string cardNum;
        string PIN;
        BankModel(string _cardNum)
        {
            cardNum = _cardNum;
        }
        public void login()
        {
            for (int i = cardNum.Length - 4; i < cardNum.Length; i++)
            {
                PIN = PIN + cardNum[i];
            }
        }
        public int getBalance()
        {
            return balance;
        }
        public bool takeCash(int amount)
        {
            if (balance >= amount)
            {
                balance = balance - amount;
                return true;
            }
            else
            {
                return false;
            }
        }
      
    }
}
